package mianshi.meituan;

import java.util.Scanner;

public class Main1 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = scanner.nextInt();
        }
        int res = 0, mul;

        for (int i = 0; i < nums.length; i++) {
            for (int j = i; j < nums.length; j++) {
                mul = 1;
                for (int k = i; k <= j; k++) {
                    mul *= nums[k];
                }
                if (mul > 0) {
                    res++;
                }

            }
        }
        System.out.println(res);

    }
}
